<template>
  <div>
    <el-button type="warning" @click="tongbushow">同步商品</el-button>
    <el-dialog title="同步商品" :visible.sync="log" width="700px">
      <div class="flex">
        <el-select v-model="tongbuall.from" placeholder="请选择从哪同步">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.name"
              :value="item.value">
            </el-option>
        </el-select>
            同步到
        <el-select v-model="tongbuall.to" placeholder="请选择同步到哪">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.name"
              :value="item.value">
            </el-option>
        </el-select>
      </div>


    	  <span slot="footer" class="dialog-footer">
    		<el-button @click="log = false">取消</el-button>
    		<el-button type="primary" @click="tongbugo">仔细瞧瞧，确定同步</el-button>
    	  </span>

    </el-dialog>
  </div>

</template>

<script>
  import axios from 'axios'
  export default {
    name: 'tongbu',
    data() {
      return {
        log:false,
        options:[
          {name:"抖音",value:15},
          {name:"抖音2",value:1},
          {name:"抖音3",value:3},
          {name:"抖音4",value:4},
          {name:"快手",value:5},
          {value:6,name:"小程序"},
          {value:7,name:"快手2"},
          {value:8,name:"快手3"},
          {value:9,name:"快手4"},
          {value:10,name:"盘古"},
          {value:11,name:"微步"},
          {value:12,name:"快手短视频"},
          {value:13,name:"选号商品"},
          {value:14,name:"微信"}
        ],
        tongbuall:{
          from:"",
          to:""
        }
      }
    },
    created() {

    },
    mounted() {

    },
    methods: {
      tongbushow:function(){
        this.log = true
      },
      tongbugo:function(){
        axios.post('/api/plan-market/web/page/move', this.tongbuall)
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message.success('同步成功');
              this.log = false
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      }
    }

  }
</script>

<style scoped>

</style>
